package com.ssm.server.feign.factory;

import com.ssm.server.feign.builder.MyFeignBuilder;
import org.springframework.beans.factory.FactoryBean;

public class MyFeignClientFactoryBean<T> implements FactoryBean<T> {
    private Class<T> type;

    public MyFeignClientFactoryBean(){

    }
    public MyFeignClientFactoryBean(Class<T> t){
        this.type = t ;
    }

    @Override
    public T getObject() throws Exception {
        return MyFeignBuilder.createFeign(this.type);
    }

    @Override
    public Class<?> getObjectType() {
        return type;
    }
}
